﻿using System;
using System.Collections.Generic;
using System.Text;

namespace VkSample48
{
    public class BeltData
    {
        public uint VCount { get; set; }

        public float[] Data { get; set; }

        public void GenVertexData()
        {
            int n = 6;
            VCount = (uint)(2 * (n + 1));
            float angdegBegin = -90;
            float angdegEnd = 90;
            float angdegSpan = (angdegEnd - angdegBegin) / n;
            Data = new float[VCount * 6];
            int count = 0;
            for(float angdeg = angdegBegin; angdeg <= angdegEnd; angdeg += angdegSpan)
            {
                float angrad = angdeg / 180.0f * MathF.PI;
                Data[count++] = -0.6f * 50.0f * MathF.Sin(angrad);
                Data[count++] = 0.6f * 50.0f * MathF.Cos(angrad);
                Data[count++] = 0;
                Data[count++] = 1;
                Data[count++] = 1;
                Data[count++] = 1;
                Data[count++] = -50 * MathF.Sin(angrad);
                Data[count++] = 50 * MathF.Cos(angrad);
                Data[count++] = 0;
                Data[count++] = 0;
                Data[count++] = 1;
                Data[count++] = 1;
            }
        }
    }
}
